package com.study.test.bank;


/**
 * molpay 支付状态码
 */
public enum PayMolPayStatus {

    SUCCESS("00", "SUCCESS"),
    FAILURE("11", "FAILURE"),
    PENDING("22", "PENDING");

    /**
     * 编号
     */
    private String code;

    /**
     * 描述
     */
    private String desc;


    PayMolPayStatus(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static PayMolPayStatus getByCode(String code) {
        if (null == code) {
            return null;
        }
        for (PayMolPayStatus status : values()) {
            if (status.getCode().equals(code)) {
                return status;
            }
        }
        return null;
    }
}
